<!DOCTYPE html>
<html>
 <head> 
  <meta charset="utf-8" /> 
  <script src="https://cdn.bootcss.com/angular.js/1.4.6/angular.min.js"></script> 
 </head> 
 <body> 
  <p>尝试修改以下表单。</p> 
  <div ng-app="myApp" ng-controller="myCtrl" ng-init="quantily=1;cost=5">
    名: <input type="text" ng-model="firstName" /><br /> 
    姓: <input type="text" ng-model="lastName" /><br /> <br /> 
    姓名: {{firstName + &quot; &quot; + lastName}} <br/>
   
	数量：<input type="number" ng-model="quantily">
	价格：<input type="number" ng-model="cost"> 
	<p>总价:{{quantily * cost}}</p>
  </div> 
  
  <div ng-app="ngobj" ng-init="person={firstName:'he',lastName:'hai'}">
	<p>姓: {{person.firstName}}</p>
	<p>姓: <span ng-bind="person.firstName"></span></p>
  </div>
  
  <div ng-app="ngarr" ng-init="points=[1,2,3,4,5,6]">
	<p>第三个值为: {{ points[2] }}</p>
	<p>第三个值为: <span ng-bind="points[2]"></span></p>
  </div>  
  

	<div ng-app="ngrepeat" ng-init="names=['Jani','Hege','Kai']">
	  <p>使用 ng-repeat 来循环数组</p>
	  <ul>
		<li ng-repeat="x in names">
		  {{ x }}
		</li>
	  </ul>
	</div>
  
	<form ng-app="" name="myForm" ng-init="myText='test@qq.com'">
		EMail:<input type="email" name="myAddress" ng-model="myText" required></input>
		<span ng-show="myForm.myAddress.$error.email">不是一个合法的邮箱地址</span>
	</form>
	
	<script>
		var app = angular.module('myApp', []);
			app.controller('myCtrl', function($scope) {
				$scope.firstName= "John";
				$scope.lastName= "Doe";
			});
	</script>  
 </body>
</html>